package com.test.dozer;

import com.tmpt.utils.DateTool;
import org.dozer.DozerBeanMapper;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wxy on 2017/9/13.
 */
public class Main1 {
    public static void main(String[] args) {
        User user = new User();
        user.setId(1);
        user.setName("hello");
        user.setPassword("123456");
        Info info = new Info();
        info.setCreateDate(DateTool.getCurTimestamp());
        info.setGender(GenderType.female);
        info.setMoneyFen(null);
        user.setInfo(info);

        List myMappingFiles = new ArrayList<>();
        myMappingFiles.add("dozer-config/dozer1BeanMapping.xml");
        DozerBeanMapper mapper = new DozerBeanMapper();
        mapper.setMappingFiles(myMappingFiles);

        //Mapper mapper = DozerBeanMapperSingletonWrapper.getInstance();
        UserVo userVo = mapper.map(user, UserVo.class);

        //.out.println(userVo.getName());
        //.out.println(userVo.getInfo().getDate());
        //.out.println(userVo.getInfo().getGender());
        //.out.println(userVo.getInfo().getMoneyYuan());


    }
}
